<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      width: 200px;
      height: 200px;
      border: 3px solid #000;
      font-size: 30px;
      margin-top: 10px;
    }
    .pink {
      background-color: pink;
    }
    .big {
      width: 300px;
      height: 300px;
    }
  </style>
</head>
<body>
  <div id="app">
    <!-- 对象 -> 键是类名,值是布尔值 -->
    <!-- 适用场景: 类名来回切换 -->
    <!-- <div class="box" :class="{ pink: false, big: true }">黑马程序员</div> -->

    <!-- 数组 -> 数组中所有的类,都会添加到盒子上,本质上是个class列表 -->
    <!-- 适用场景: 批量添加或删除类 -->
    <div class="box" :class="['pink', 'big']">黑马程序员</div>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"></script>
  <script>
    new Vue({
      el: '#app',
      data: {

      }
    })
  </script>
</body>
</html>